<?php if (!defined('THINK_PATH')) exit(); /*a:1:{s:59:"/data/www/jue/vdma/application/index/view/index/events.html";i:1508921916;}*/ ?>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=0">
    <meta name="imagemode" content="force">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="format-detection" content="telephone=no">
    <meta name="keywords" content="">
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="shortcut icon" type="image/x-icon" href="">
    <link rel="apple-touch-icon-precomposed" href="">
    <link href="__STATIC__/assets/css/main.css" rel="stylesheet" />
    <link href="__STATIC__/assets/css/animate.min.css" rel="stylesheet" />
    <link href="__STATIC__/assets/css/swiper.min.css" rel="stylesheet" />
    <script src="__STATIC__/assets/js/jquery.min.js"></script>
    <script src="__STATIC__/assets/js/swiper.min.js"></script>
    <script src="__STATIC__/assets/js/swiper.animate.min.js"></script>
		<title></title>
	<style>
		.container-personcenter-footer ul li:nth-child(3) img{
				top: -10%;
			}
			.container-news ul li  p:nth-child(1){
				width: 100%;
    text-align: center;
    font-size: 15px;
    color: #003e52;
    overflow: hidden;
    margin-bottom: 2%;
			}
			.container-news ul li img{
				width: 100%;
				height:200px;
				overflow: hidden;
			}
			.container-news ul li {
    height:auto!important;
    width: auto!important;
    margin-bottom: 20px;
    }
    .container-news ul li p:nth-child(3){
    	       text-align: left;
    padding: 4%;
    margin-top: -6%;
    font-size: 14px;
    color: #f49100;
    width: 30%;
    overflow: hidden;
    }
    .container-news ul li p:nth-child(4){
    	          text-align: left;
    padding: 4%;
    margin-top: -6%;
    font-size: 14px;
    color: #f49100;
    width: 30%;
    overflow: hidden;
    height: 0px;
    }
    .bmbtn{
    	     padding: 10px 10px 10px 10px;
    border: none;
    width: 120px;
    float: right;
    background: #006582;
    color: #fff;
    margin: -9% 5%;
    }
    .container-news {
        width: 92%;
    margin-top: 0.4rem;
    overflow-y: auto;
    height: 480px;
    margin-bottom: 27%;
}
.mygds{
	width:100%;
    height: 40px;
    color: #333;
    text-align: center;
    font-size: 12px;
    margin-top: -24%;
    line-height: 20px;
}
		</style>
	</head>
	<body>
		 <div class="news-header"></div>
	    
    <div class="container-news">
    	<ul>
    		<!--<li >
    		    <p>fdjgjgdf</p>
    		    <img src="assets/img/header-banner.png">
    		    <p>sdh</p>
    		    <p>jhdsgfjhgjhdsgfv</p>
    		     <input type="button" class="bmbtn" onclick="enroll(this)" value="立即报名"  />
    		</li>
    		<li>
    			 <p>fdjgjgdf</p>
    		    <img src="assets/img/header-banner.png">
    		    <p>sdh</p>
    		    <p>jhdsgfjhgjhdsgfv</p>
    		     <input type="button" class="bmbtn" onclick="enroll(this)" value="立即报名"  />
    			
    		</li>-->
    	</ul>

    </div>
        	<div class="mygds"></div>

     <div class="container-personcenter-footer">
                  <ul>
                      <li class="footbannera"><img src="__STATIC__/assets/img/centerb.png" /></li>
                      <li class="footbannerb"><img src="__STATIC__/assets/img/centerd.png" /></li>
                      <li class="footbannerc"><img src="__STATIC__/assets/img/centere.png" /></li>
                  </ul>
              </div>
	</body>
	 <script>
    	$(document).ready(function(){
    		var gs = 3        
          $.ajax({
            type: "post",
            url: "ajaxevents",
               data: {"num":0},
            success: function (data) {
            	//成功后回调
              if(data.code == 1){
   
              	console.log(data)
              	var events = data.events;
              	$.each(events, function(key, val) { 
              		if(data.events[key].activity_link==null){
              			data.events[key].activity_link="##"
              		}
              		if(typeof val == "object"){
              			$(".container-news ul").append(
                             	'<li>'+
            	
            	    '<p>'+data.events[key].activity_title+'</p>'+
            	 '<img src="/vdma/public/uploads/'+ data.events[key].activity_img +'">'+
            	      '<p>'+data.events[key].activity_place+'</p>'+
					  '<p>'+data.events[key].activity_time+'</p>'+
					'<a href="'+data.events[key].activity_link+'">'+
            	      '<input type="button" class="bmbtn"  value="立即报名"  />'+
            	       '</a>'+
            	 '</li>'
                             )
              		}
                                            
                       	
				}); 

              }else{
              	             
//                 $(".mygds").text("已经没有更多了");
              
              }


            }
            
        })
     //轮播
      $(".container-news").scroll(function () {
        var h = $(this).height();
        var sh = $(this)[0].scrollHeight;
        var st =$(this)[0].scrollTop;
         console.log(h)
         console.log(sh)
         console.log(st)
        if(h+st>=sh-1){
              $.ajax({
            type: "post",
            url: "ajaxevents",
               data: {"num":gs},
            success: function (data) { 
            	//成功后回调
            
              if(data.code == 1){
              	var events = data.events;
              	$.each(events, function(key, val) { 
              		if(data.events[key].activity_link==null){
              			data.events[key].activity_link="##"
              		}
            		if(events[key].activity_title==null||events[key].activity_title==""){
            			events[key].activity_title = "暂无"
               	}
          		if(events[key].activity_place==null||events[key].activity_place==""){
           			events[key].activity_place = "暂无"
               	}
          		if(events[key].activity_time==null||events[key].activity_time==""){
           			events[key].activity_time = "暂无"
               	}
              		if(typeof val == "object"){
              			$(".container-news ul").append(
                             	'<li class="zoomIn animated onehalfsec">'+
            	    '<p>'+data.events[key].activity_title+'</p>'+
            	 '<img src="/vdma/public/uploads/'+ data.events[key].activity_img +'">'+
            	      '<p>'+data.events[key].activity_place+'</p>'+
					  '<p>'+data.events[key].activity_time+'</p>'+
					  '<a href="'+data.events[key].activity_link+'">'+
            	      '<input type="button"  class="bmbtn"  value="立即报名"  />'+
            	      '</a>'+
            	 '</li>'
                             ) 
              		}
                                           
                       
				}); 

              }else{
              	if(data.code==0){
              		$(".mygds").text("已经没有更多了");
              		
              	}
              	             
//                
              
              }

	                    gs+=3
//                     	console.log(nums)
            }
            //beforeSend: function(){  /发送请求前调用，可以放一些"正在加载"之类额话
            //    alert("正在加载");
            //}
            //})
        })
        }else{
        		$(".mygds").text("");
        }
    })
      
      
       $(".footbannera").click(function() {
            window.location.href = "<?php echo url('index'); ?>";
        })
        $('.footbannerb').click(function() {
         window.location.href = "<?php echo url('events'); ?>";
        })
         $(".footbannerc").click(function() {
            window.location.href = "<?php echo url('personcenter'); ?>";
        })
      
        
})
    </script>
    
</html>
